package io.renren.modules.listinfo.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.listinfo.dao.ListinfoDao;
import io.renren.modules.listinfo.entity.ListinfoEntity;
import io.renren.modules.listinfo.service.ListinfoService;


@Service("listinfoService")
public class ListinfoServiceImpl extends ServiceImpl<ListinfoDao, ListinfoEntity> implements ListinfoService {

    @Autowired
    ListinfoDao listinfoDao;
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String listno =(String) params.get("key");//模糊查询
        IPage<ListinfoEntity> page = this.page(
                new Query<ListinfoEntity>().getPage(params),
                new QueryWrapper<ListinfoEntity>().like("listno",listno)
        );

        return new PageUtils(page);
    }

    @Override
    public List<ListinfoEntity> getlistinfo(String listNo, String listProject, String empName, String listState) {
        return listinfoDao.getlistinfo(listNo,listProject,empName,listState);
    }

}